﻿/// <reference path="../app.ts" />
/// <reference path='../../typings/angularjs/angular.d.ts'/>
/// <reference path='../../typings/moment/moment.d.ts'/>

appRoot.filter('getByProperty', [function () {
    return function (propertyName, propertyValue, collection) {
        if (collection != null) {
            var i = 0, len = collection.length;
            for (; i < len; i++) {
                if (collection[i][propertyName] == +propertyValue) {
                    return collection[i];
                }
            }
        }
        return null;
    };
}]);


